<form [formGroup]="orgUserForm">
  <nz-form-item>
    <nz-form-label nzRequired nzFor="orgName">企业名称</nz-form-label>
    <nz-form-control [nzValidateStatus]="nameFlag" nzHasFeedback>
      <input nz-input formControlName="orgName" id="orgName" (blur)="isOrgNameRepeat()" />
      <nz-form-explain *ngIf="nameFlag === 'error'">
        <span class="text-danger">
          企业名称重复!
        </span>
      </nz-form-explain>
      <nz-form-explain *ngIf="!(orgUserForm.get('orgName').valid || orgUserForm.get('orgName').untouched)">
        <span class="text-danger" *ngIf="orgUserForm.get('orgName').hasError('required')">
          带*项不能为空!
        </span>
      </nz-form-explain>
    </nz-form-control>
  </nz-form-item>

  <nz-divider nzText="管理员信息" nzOrientation="left"></nz-divider>

  <nz-form-item>
    <nz-form-label nzFor="" nzRequired>邮箱</nz-form-label>
    <nz-form-control [nzValidateStatus]="msgFlag" nzHasFeedback>
      <input type="text" nz-input nzSize="default" formControlName="email" placeholder="邮箱" (blur)="isEmailRepeat()">
      <nz-form-explain *ngIf="msgFlag === 'error'">
        <span class="text-danger">
          邮箱重复!
        </span>
      </nz-form-explain>
      <nz-form-explain *ngIf="!(orgUserForm.get('email').valid || orgUserForm.get('email').untouched)">
        <span class="text-danger" *ngIf="orgUserForm.get('email').hasError('required')">带*项不能为空!</span>
        <span class="text-danger" *ngIf="orgUserForm.get('email').hasError('email')">邮件格式不正确!</span>
      </nz-form-explain>
    </nz-form-control>
  </nz-form-item>

  <div nz-row nzGutter="8" nzType="flex" nzJustify="space-between">
    <div nz-col nzSpan="12">
      <nz-form-item>
        <nz-form-label nzFor="" nzRequired>名字</nz-form-label>
        <nz-form-control>
          <input type="text" nz-input nzSize="default" formControlName="lastName" placeholder="名字">
          <nz-form-explain *ngIf="!(orgUserForm.get('lastName').valid || orgUserForm.get('lastName').untouched)">
            <span class="text-danger" *ngIf="orgUserForm.get('lastName').hasError('required')">带*项不能为空!</span>
          </nz-form-explain>
        </nz-form-control>
      </nz-form-item>
    </div>

    <div nz-col nzSpan="12">
      <nz-form-item>
        <nz-form-label nzFor="" nzRequired>姓氏</nz-form-label>
        <nz-form-control>
          <input type="text" nz-input nzSize="default" formControlName="firstName" placeholder="姓氏">
          <nz-form-explain *ngIf="!(orgUserForm.get('firstName').valid || orgUserForm.get('firstName').untouched)">
            <span class="text-danger" *ngIf="orgUserForm.get('firstName').hasError('required')">带*项不能为空!</span>
          </nz-form-explain>
        </nz-form-control>
      </nz-form-item>
    </div>
  </div>

  <nz-form-item>
    <nz-form-control class="modal-footer">
      <button nz-button nzType="primary" class="modal-footer-btn"
        (click)="saveOrgUser()">确&nbsp;&nbsp;&nbsp;&nbsp;定</button>
      <button nz-button nzType="default" class="modal-footer-btn" nzGhost
        (click)="destroyModal()">取&nbsp;&nbsp;&nbsp;&nbsp;消</button>
    </nz-form-control>
  </nz-form-item>
</form>